home *** CD-ROM | disk | FTP | other *** search
- on exitFrame
- global iscript, total_pages
- cursor(4)
- set first_text_cast to the number of cast "i1"
- set last_text_cast to 8
- set text_cast to 0
- set read_line to 1
- set read_text to EMPTY
- set write_page to 1
- set iscript to []
- set lines_per_page to 55
- set spaces to " "
- repeat while text_cast < last_text_cast
- set read_text to the text of cast (first_text_cast + text_cast)
- set last_read_line to the number of lines in read_text
- set read_line to 1
- repeat while read_line < last_read_line
- if line read_line of read_text = EMPTY then
- set read_line to read_line + 1
- if line read_line of read_text = EMPTY then
- set read_line to read_line + 1
- end if
- end if
- set end_line to read_line + lines_per_page - 1
- set test_line to line end_line of read_text
- if (test_line starts spaces) or (test_line starts "INT.") or (test_line starts "EXT.") then
- set end_line to end_line - 1
- set test_line to line end_line of read_text
- if test_line starts spaces then
- set end_line to end_line - 1
- end if
- end if
- append(iscript, line read_line to end_line of read_text)
- set read_line to end_line + 1
- end repeat
- set text_cast to text_cast + 1
- end repeat
- put "Done parsing iscript text."
- set total_pages to count(iscript) - 1
- end
-